function  [texture_mat,location_mat, color_mat] = normalize_data_seg(org_text_mat,org_loc_mat,org_color_mat)

% This function normalize data that comes from segments' features.
 
% Function Inputs:
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% org_text_mat - texture fetures matrix.
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% org_loc_mat - location fetures matrix.
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% org_color_mat - color fetures matrix.
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

% Function Outputs:
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% texture_mat - texture fetures matrix after normalization.
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% location_mat - location fetures matrix after normalization.
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% color_mat - color fetures matrix after normalization.
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

texture_mat = org_text_mat;
location_mat = org_loc_mat;
color_mat = org_color_mat;
filters_num=24;       

% texture_mat
text_min = min(org_text_mat,[],2);
text_max = max(org_text_mat,[],2); 
for i=1:filters_num+1
    texture_mat(i,:) = (org_text_mat(i,:) - text_min(i))/(text_max(i) - text_min(i));
end 
texture_mat(filters_num+2,:) = (org_text_mat(filters_num+2,:) - 1)/(filters_num-1);
texture_mat(filters_num+3,:) = (org_text_mat(filters_num+3,:) - text_min(filters_num+3))/(text_max(filters_num+3) - text_min(filters_num+3));
texture_mat(filters_num+4,:) = org_text_mat(filters_num+4,:)/255;
% color_mat
for i=1:3
    color_mat(i,:) = org_color_mat(i,:) /255;
end
